package logic

import (
	"context"

	"go-zero-mall/app/product/cmd/rpc/internal/svc"
	"go-zero-mall/app/product/cmd/rpc/pb"

	"github.com/zeromicro/go-zero/core/logx"
)

type PmsAlbumPicInfoDeleteLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewPmsAlbumPicInfoDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PmsAlbumPicInfoDeleteLogic {
	return &PmsAlbumPicInfoDeleteLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *PmsAlbumPicInfoDeleteLogic) PmsAlbumPicInfoDelete(in *pb.PmsAlbumPicInfoDeleteReq) (*pb.PmsAlbumPicInfoDeleteResp, error) {
	err := l.svcCtx.PmsAlbumPicModel.Delete(l.ctx, in.Id)
	if err != nil {
		return nil, err
	}
	return &pb.PmsAlbumPicInfoDeleteResp{}, nil
}
